<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue2.js"></script>

</head>

<body>
    <div id="app">
        <p>{{message}}</p>
        <p>{{isMan?'男':"女"}}</p>
        <p v-text="num+2"></p>
        <p v-html="msg"></p>
        <button @click="num++">++</button>
        <button @click="change(123,$event)">chang event</button>
        <img :src="img_url"><br>
        用户名：<input type="text" v-model="username"><br>
        密码：<input type="password" v-model="password"><br>
        <button @click="denlu">登录</button>
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                message: 'hellow world',
                isMan: true,
                num: 10,
                msg: '<div style="color:blue">hellow world2</div>',
                img_url: 'img/01.png',
                username: '李华',
                password: 1234,
            },
            methods: {
                change(value, e) {
                    console.log(value, e)
                },
                denlu() {
                    console.log(this.username, this.password);
                }
            }
        })
    </script>
</body>

</html>